package com.mvnframe.controller;



import com.mvnframe.service.StuService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletException;
import java.io.IOException;
import java.util.List;

@Controller
@RequestMapping("/stu")
public class StudentController {

    Logger log = Logger.getLogger(StudentController.class);
    @Autowired
    StuService stuService;//=new StuServiceImpl();

    @RequestMapping()
    String stusc() throws ServletException, IOException {
        return "stusc";
    }


    @RequestMapping("/json")
    @ResponseBody
    List select(String sname, int pageNo) throws ServletException, IOException {
        log.debug(pageNo);
        List lst = stuService.getStus(sname, pageNo);
        log.debug(lst);
        return lst;
    }


}
